from pprint import pprint
# type 查看数据类型
'''
print(type(123))
print(type('123'))
print(type(True))

class A:
    pass

a = A()
print(type(a))
'''
'''
# dir 查看对象上的所有方法和属性
class A:
    def __init__(self,name):
        self.name = name

    def fn(self):
        pass

a = A('aaa')

pprint(dir(a))
'''
# isinstance 查看对象是否属于某个类, True|False
# print(isinstance(111, int))
# print(isinstance('111', str))

class A:
    pass

a = A()
print(isinstance(a, A))

class B:
    pass
b = B()
print(isinstance(b, A))

class A:
    pass


class B(A):
    pass

print(type(B()))
print(A)

print(isinstance(A(), A))
print(type(A()) == A)

print(isinstance(B(), A))
print(type(B()) == A)